import Decimal from 'decimal.js';
//根据折扣计算新的价格
export default function getNewPrices(price: number, discount: number) {
  //先将这两个数据都转化为Decimal对象
    let newPrice: Decimal = new Decimal(price);
    let newDiscount: Decimal = new Decimal(discount);
    //乘法保留两位小数
    return newPrice.mul(newDiscount).toDecimalPlaces(2);
}